function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
% function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T             [#temp variables by 1]     double   vector of temporary terms to be filled by function
%   y             [#dynamic variables by 1]  double   vector of endogenous variables in the order stored
%                                                     in M_.lead_lag_incidence; see the Manual
%   x             [nperiods by M_.exo_nbr]   double   matrix of exogenous variables (in declaration order)
%                                                     for all simulation periods
%   steady_state  [M_.endo_nbr by 1]         double   vector of steady state values
%   params        [M_.param_nbr by 1]        double   vector of parameter values in declaration order
%   it_           scalar                     double   time period for exogenous variables for which
%                                                     to evaluate the model
%   T_flag        boolean                    boolean  flag saying whether or not to calculate temporary terms
%
% Output:
%   g1
%

if T_flag
    T = bbeffectivedemandmatchirf_order3.dynamic_g1_tt(T, y, x, params, steady_state, it_);
end
g1 = zeros(30, 53);
g1(1,4)=(-(T(1)*y(30)*T(65)));
g1(1,21)=(-(T(2)*params(23)*y(36)*T(71)));
g1(1,30)=(-(T(1)*y(4)*T(65)));
g1(1,35)=1;
g1(1,36)=(-(T(2)*params(23)*y(21)*T(71)));
g1(2,11)=1;
g1(2,12)=(-1);
g1(2,4)=(-params(14));
g1(2,19)=params(14)/y(27);
g1(2,21)=(-y(34));
g1(2,27)=(-(params(14)*y(19)))/(y(27)*y(27));
g1(2,34)=(-y(21));
g1(3,11)=(-(T(3)/(1-y(21))));
g1(3,21)=(-(y(11)*T(3)/((1-y(21))*(1-y(21)))));
g1(3,34)=1;
g1(4,10)=(-(T(43)*T(44)));
g1(4,11)=(-(T(44)*T(54)));
g1(4,17)=(-(T(44)*T(61)));
g1(4,21)=(-(T(44)*params(24)*T(42)*y(10)*T(4)*T(72)));
g1(4,32)=1;
g1(5,17)=1;
g1(5,49)=(-(getPowerDeriv(y(49),1-params(9),1)));
g1(6,20)=(-((-((y(35)+params(15))*(1-params(1))))/(y(20)*y(20))));
g1(6,21)=y(34);
g1(6,34)=y(21);
g1(6,35)=(-((1-params(1))/y(20)));
g1(7,4)=y(30)*y(28);
g1(7,20)=(-((-((y(35)+params(15))*params(1)))/(y(20)*y(20))));
g1(7,28)=y(30)*y(4);
g1(7,30)=y(4)*y(28);
g1(7,35)=(-(params(1)/y(20)));
g1(8,14)=y(4)*y(30)*y(25);
g1(8,4)=y(30)*y(25)*y(14);
g1(8,20)=(-((-((y(35)+params(15))*params(1)))/(y(20)*y(20))));
g1(8,25)=y(4)*y(30)*y(14);
g1(8,30)=y(4)*y(25)*y(14);
g1(8,35)=(-(params(1)/y(20)));
g1(9,13)=y(4);
g1(9,18)=(-(1+y(4)*(-(T(10)*T(62)*T(63)))));
g1(9,4)=(-(T(11)+y(4)*(-(T(10)*T(63)*T(66)))));
g1(9,19)=1;
g1(10,13)=1;
g1(10,30)=(-(params(4)+params(5)/2*2*(y(30)-1)));
g1(11,14)=1;
g1(11,30)=(-params(5));
g1(12,1)=(-(T(22)*T(19)*params(2)*T(40)*T(41)));
g1(12,10)=(-(T(22)*T(19)*params(2)*T(41)*T(47)));
g1(12,2)=(-(T(22)*(T(19)*params(2)*T(41)*T(51)+T(18)*T(52))));
g1(12,11)=(-(T(22)*(T(19)*params(2)*T(41)*T(55)+T(18)*T(56))));
g1(12,3)=(-(T(18)*T(19)*T(60)));
g1(12,5)=(-(T(22)*T(19)*params(2)*T(41)*T(70)));
g1(12,21)=(-(T(22)*T(19)*params(2)*T(41)*T(73)));
g1(12,29)=1;
g1(12,32)=(-(T(18)*T(19)*T(79)));
g1(13,27)=(-y(47));
g1(13,47)=(-y(27));
g1(14,44)=(-T(76));
g1(14,26)=(-(y(47)*T(23)));
g1(14,47)=(-(y(26)*T(23)));
g1(15,40)=(-(y(47)/y(22)));
g1(15,22)=(-((-(y(47)*(y(40)+y(43))))/(y(22)*y(22))));
g1(15,43)=(-(y(47)/y(22)));
g1(15,47)=(-((y(40)+y(43))/y(22)));
g1(16,23)=(-((1-params(16))*params(17)*T(74)/T(25)));
g1(16,6)=(-(params(16)*1/y(6)));
g1(16,26)=1/y(26);
g1(16,8)=(-((1-params(16))*params(18)*T(80)/T(26)));
g1(16,35)=(-((1-params(16))*params(18)*T(81)/T(26)));
g1(17,12)=1;
g1(17,18)=1;
g1(17,4)=params(14);
g1(17,19)=params(14)*(-(1/y(27)));
g1(17,21)=y(34);
g1(17,23)=y(35)*params(7)/2*T(74)*2*(T(25)-1);
g1(17,27)=params(14)*(-((-y(19))/(y(27)*y(27))));
g1(17,34)=y(21);
g1(17,35)=(-(1-T(27)));
g1(18,41)=(-(y(47)*(-y(45))/y(25)));
g1(18,42)=(-(y(47)*y(45)*(params(8)*(T(28)-params(3))*T(64)+T(28)*params(8)*T(64)-T(10)*T(64)*2*(T(28)-params(3)))/y(25)));
g1(18,19)=(-(y(47)*y(45)*(params(8)*(T(28)-params(3))*T(67)+T(28)*params(8)*T(67)-T(10)*2*(T(28)-params(3))*T(67))/y(25)));
g1(18,25)=(-((-T(30))/(y(25)*y(25))));
g1(18,45)=(-(y(47)*T(29)/y(25)));
g1(18,46)=(-(y(47)*y(48)/y(25)));
g1(18,47)=(-((y(48)*y(46)+y(45)*T(29))/y(25)));
g1(18,48)=(-(y(47)*y(46)/y(25)));
g1(19,18)=params(8)*T(62);
g1(19,4)=params(8)*T(66);
g1(19,25)=(-1)/(y(25)*y(25));
g1(20,20)=(-((-params(13))/(y(20)*y(20))));
g1(20,23)=params(7)*(T(25)-1)*T(74)+T(25)*params(7)*T(74);
g1(20,44)=(-(T(34)*T(74)+T(32)*T(33)*y(47)*params(7)*T(74)));
g1(20,47)=(-(T(32)*T(33)*params(7)*(T(32)-1)));
g1(20,35)=(-(T(32)*y(47)*params(7)*(T(32)-1)*T(82)));
g1(20,50)=(-(T(32)*y(47)*params(7)*(T(32)-1)*T(83)));
g1(21,20)=(-y(35));
g1(21,24)=1;
g1(21,35)=(-(y(20)-1));
g1(22,40)=T(57);
g1(22,15)=1;
g1(22,22)=(-((-(y(40)+y(43)))/(y(22)*y(22))));
g1(22,43)=T(57);
g1(23,40)=(-(2*(y(40)+y(43))/T(37)));
g1(23,16)=1;
g1(23,22)=(-((-(T(36)*2*y(22)))/(T(37)*T(37))));
g1(23,43)=(-(2*(y(40)+y(43))/T(37)));
g1(24,15)=2*y(15);
g1(24,16)=(-1);
g1(24,31)=1;
g1(25,1)=(-params(19));
g1(25,10)=1;
g1(25,7)=(-x(it_, 1));
g1(25,51)=(-y(7));
g1(26,7)=(-params(20));
g1(26,33)=1;
g1(26,52)=(-params(21));
g1(27,9)=(-params(22));
g1(27,36)=1;
g1(27,53)=(-params(49));
g1(28,44)=T(76);
g1(28,26)=y(47)*T(23);
g1(28,47)=y(26)*T(23);
g1(28,37)=1;
g1(29,27)=y(47);
g1(29,47)=y(27);
g1(29,38)=1;
g1(30,20)=(-params(13))/(y(20)*y(20));
g1(30,23)=(-(params(7)*(T(25)-1)*T(74)+T(25)*params(7)*T(74)));
g1(30,44)=T(34)*T(74)+T(32)*T(33)*y(47)*params(7)*T(74);
g1(30,47)=T(32)*T(33)*params(7)*(T(32)-1);
g1(30,35)=T(32)*y(47)*params(7)*(T(32)-1)*T(82);
g1(30,50)=T(32)*y(47)*params(7)*(T(32)-1)*T(83);
g1(30,39)=1;

end
